<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>json数据嵌套</title>
</head>
<body>
  <script type="text/javascript">
    /**
     * 随机相互嵌套
     */
    var json = {
        "k1" : [
            {"name":"zhangsan"},
            {"name":"lisi"}
        ],
        "k2":[
            {"name":"wangwu"},
            {"name":"xiaoli"}
        ]
    };
    console.log(json.k1[1].name)
    for (var i = 0; i < json.k2.length; i++) {
        console.log(json.k2[i].name)
    }
  </script>
</body>
</html>